/*
 * To change this template, choose Tools | Templates and open the template in
 * the editor.
 */
package cn.eclass.bean;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import cn.eclass.bean.api.IAdvertiseBean;
import cn.eclass.dao.AdvertiseDao;
import cn.eclass.entity.AdCategoryEntity;
import cn.eclass.entity.AdvertiseEntity;

/**
 *
 * @author Administrator
 */
public class AdvertiseBean implements IAdvertiseBean {

    AdvertiseDao dao = new AdvertiseDao();
    
    @Override
    public List<AdvertiseEntity> getAdsByCat(int catId) {
    	return dao.getByCat(catId);
    }
    
    

    @Override
    public AdvertiseEntity add(AdvertiseEntity advertise) {
        int newId = dao.add(advertise);
        advertise.setId(newId);
        return advertise;
    }

    @Override
    public boolean update(AdvertiseEntity advertise) {
        return dao.update(advertise);
    }

    @Override
    public boolean delete(int id) {
        return dao.delete(id);
    }

    @Override
    public AdvertiseEntity get(int id) {
        return dao.get(id);
    }

    @Override
    public List<AdvertiseEntity> list() {
        return dao.list();
    }
    
    @Override
    public List<AdvertiseEntity> list(AdCategoryEntity adCategoryEntity) {
        return dao.list(adCategoryEntity);
    }
}
